<html>
<head><meta charset="utf-8"><title>SyntaxRewriter is accidentally linear · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html">SyntaxRewriter is accidentally linear</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219632698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219632698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219632698">(Dec 11 2020 at 17:09)</a>:</h4>
<p><span class="user-mention" data-user-id="300586">@Lukas Wirth</span> this is a fun one (and utterly embarrassing, to be honest). </p>
<p>So, I've recently fixed O(N^2) behavior in SyntaxRewriter... But it is still kinda slow. I think the reason for this slowness is that it rebuilds the whole tree (we always allocate a new GreenNode, we don't try to re-use the old one). Aaaaand, even if we fix it, SyntaxRewriter will still be linear in the size of the file -- it traverses each and every node. </p>
<p>This actually defeats the purpose of our elaborate syntax trees, whose functional design is geared towards cheap O(height) modification. And the original C#'s SyntaxRewriter has the same issue. I guess we need to find a new abstraction for this...</p>



<a name="219633289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219633289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219633289">(Dec 11 2020 at 17:14)</a>:</h4>
<p>Ye, I noticed that we clone the entire tree as well(I think I wrote that down in the issues we were talking about the slowness as well somewhere).<br>
I also looked at how roslyn does it but I couldn't really get behind their node tracking stuff they are using, but I guess that doesn't change the complexity either then for them.</p>



<a name="219633493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219633493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219633493">(Dec 11 2020 at 17:16)</a>:</h4>
<p>yeah, I've noticied this just today....</p>



<a name="219633523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219633523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219633523">(Dec 11 2020 at 17:16)</a>:</h4>
<p>otoh, I am now inspired to maybe make the tree mutable&amp;clonnable....</p>



<a name="219633880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219633880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219633880">(Dec 11 2020 at 17:19)</a>:</h4>
<p>Won't that bring its fair share of problems as well though?</p>



<a name="219633987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219633987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219633987">(Dec 11 2020 at 17:20)</a>:</h4>
<p>Most definitely</p>



<a name="219634014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219634014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219634014">(Dec 11 2020 at 17:20)</a>:</h4>
<p>But I want to try this angle as well...</p>



<a name="219634598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219634598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219634598">(Dec 11 2020 at 17:25)</a>:</h4>
<p>Yeah, just optimizing allocs doesn't help</p>



<a name="219634789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219634789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219634789">(Dec 11 2020 at 17:26)</a>:</h4>
<p>One Idea I tried out with SyntaxRewriter was to track what branches in a tree we only have to edit. As in whenever we add a new insert/replace/deletion to the Rewriter track down all the ancestors of the affected node so that we could skip unaffected branches entirely when rewriting.</p>



<a name="219634823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219634823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219634823">(Dec 11 2020 at 17:26)</a>:</h4>
<p>But that didn't work out since some nodes where disjoint from another that were rewritten or something along those lines iirc</p>



<a name="219634997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219634997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219634997">(Dec 11 2020 at 17:28)</a>:</h4>
<p>I'm unsure whether this idea could work out in the end as I might be missing something crucial that prevents that from working entirely</p>



<a name="219644460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219644460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219644460">(Dec 11 2020 at 18:40)</a>:</h4>
<p>Right I remember why that didn't work, since the root of the node thats passed into rewriting isnt necessarily a root of the edits</p>



<a name="219713774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219713774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219713774">(Dec 12 2020 at 15:36)</a>:</h4>
<p>Ok, I am officially excited. I think we can have mutable immutable syntax trees :D</p>



<a name="219713782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219713782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219713782">(Dec 12 2020 at 15:36)</a>:</h4>
<p>Will try to write an issue which describes high-level design later today</p>



<a name="219713859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219713859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219713859">(Dec 12 2020 at 15:38)</a>:</h4>
<p>Couple of core insights:</p>
<ul>
<li>GreenNode/SytnaxNode dissolve the "functional/parent pointers" and "threadSafe/Rc" tradeoffs. They can dissolve mutable/immutable tradeoff the same way</li>
<li>Node::text_range in IntelliJ is not O(1), its O(tree depth)</li>
</ul>



<a name="219724010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219724010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219724010">(Dec 12 2020 at 19:31)</a>:</h4>
<blockquote>
<p>Will try to write an issue which describes high-level design later today</p>
</blockquote>
<p>Argh, I had a beautiful writeup in the unposted issue, and the browser ate the contents of the text field. Never write longer text in a browser</p>



<a name="219763451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763451">(Dec 13 2020 at 14:19)</a>:</h4>
<p>Ok, here it is: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/6857">https://github.com/rust-analyzer/rust-analyzer/issues/6857</a></p>
<p>cc <span class="user-mention" data-user-id="132829">@Christopher Durham</span></p>



<a name="219763507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763507">(Dec 13 2020 at 14:20)</a>:</h4>
<blockquote>
<p>Mad Scientist Mode: ON</p>
</blockquote>
<p><span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="219763625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763625">(Dec 13 2020 at 14:23)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> updated issue description</p>



<a name="219763633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763633">(Dec 13 2020 at 14:23)</a>:</h4>
<p>Incredible</p>



<a name="219763675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763675">(Dec 13 2020 at 14:24)</a>:</h4>
<p>How I Learned to Stop Worrying and Love Mutation</p>



<a name="219763781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763781">(Dec 13 2020 at 14:26)</a>:</h4>
<p>So this is what you meant with mutable immutable <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="219763870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763870">(Dec 13 2020 at 14:28)</a>:</h4>
<blockquote>
<p>How I Learned to Stop Worrying and Love Mutation</p>
</blockquote>
<p>OMG, we should use this instead of "empowering everyone to build fast and reliable software"</p>



<a name="219763972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763972">(Dec 13 2020 at 14:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116011">@Steve Klabnik</span> we need our best people on this</p>



<a name="219763980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219763980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steve Klabnik <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219763980">(Dec 13 2020 at 14:31)</a>:</h4>
<p>Hehehe</p>



<a name="219778703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219778703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219778703">(Dec 13 2020 at 20:11)</a>:</h4>
<p>This is definitely something right up my alley and something I'd love to do, but: legal ownership of code I write right now is murky at best, and I don't want to saddle r-a with that. I'm planning to try to get an exception for Rust OSS contributions, but grad school is on break until January and I don't want to bother them on break.</p>



<a name="219778948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219778948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219778948">(Dec 13 2020 at 20:15)</a>:</h4>
<p>(more context on my GH profile readme if you want a bit more)</p>



<a name="219786464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219786464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219786464">(Dec 13 2020 at 22:58)</a>:</h4>
<p>Wow your university is either evil or has been burned badly in the past to have such a strict requirement</p>



<a name="219786999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219786999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219786999">(Dec 13 2020 at 23:13)</a>:</h4>
<p><span class="user-mention" data-user-id="307289">@Poliorcetics</span> mostly it's me being overly cautious (informal policy is that stuff done on your own time with your own resources is still yours, that's just not what the actual IP Agreement doc says). The reasoning they gave for it is that it simplifies knowing who actually owns what you make, and thus transferring full commercial rights to it to you if you ask for it.</p>
<p>I still think there could be a better middle ground, but the "all IP while you're employed [or enrolled] is the company's [or university's]" is common in the games industry <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="219787062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219787062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219787062">(Dec 13 2020 at 23:14)</a>:</h4>
<p>Informally I'm sure they'd be willing to give me a written doc exception for something clearly divorced from what we're doing there, it's just I've not gone through the effort yet, and I don't want to dump that question mark on someone else's project.</p>



<a name="219787208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219787208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219787208">(Dec 13 2020 at 23:19)</a>:</h4>
<p>Because I don't want to speak ill of them without some context:<br>
Actual legal clause: <a href="https://twitter.com/CAD97_/status/1296118208034996224?s=19">https://twitter.com/CAD97_/status/1296118208034996224?s=19</a><br>
Later notes: <a href="https://twitter.com/CAD97_/status/1322633440815185921?s=19">https://twitter.com/CAD97_/status/1322633440815185921?s=19</a><br>
Of course IANAL, I'm just overly cautious when other people's projects are on the line.</p>
<div class="inline-preview-twitter"><div class="twitter-tweet"><a href="https://twitter.com/CAD97_/status/1296118208034996224?s=19"><img class="twitter-avatar" src="https://pbs.twimg.com/profile_images/1245169056480665600/aYmyZTLZ_normal.png"></a><p>Here's the actual full clause in the IP Agreement. Split into multiple images for alt-text. I'm happy to remove/correct this take if it's based on an incorrect reading, but I highly doubt it. Pre-existing IP used in new IP is even just licensed, not ownership transferred. (7/6) <a href="https://t.co/TddxBPIcOc">https://twitter.com/CAD97_/status/1296118208034996224/photo/1</a></p><span>- CAD97 (@CAD97_)</span><div class="twitter-image"><a href="https://t.co/TddxBPIcOc"><img src="https://pbs.twimg.com/media/Efy7ycAXkAcxfOm.png:medium"></a></div><div class="twitter-image"><a href="https://t.co/TddxBPIcOc"><img src="https://pbs.twimg.com/media/Efy8PWEWsAEj4am.png:large"></a></div></div></div><div class="inline-preview-twitter"><div class="twitter-tweet"><a href="https://twitter.com/CAD97_/status/1322633440815185921?s=19"><img class="twitter-avatar" src="https://pbs.twimg.com/profile_images/1245169056480665600/aYmyZTLZ_normal.png"></a><p>Coming back to this: there's another hairy corner I didn't consider that makes a looser version a bit harder to specify: students working on classwork on their own machines with their own engine licenses, not ones provided by the school. E.g. we have individual engine licenses. <a href="https://t.co/6qeCk9nlvz">https://twitter.com/CAD97_/status/1296118208034996224</a></p><span>- CAD97 (@CAD97_)</span></div></div>



<a name="219787214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219787214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christopher Durham <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219787214">(Dec 13 2020 at 23:19)</a>:</h4>
<p>(ok not going to rant here anymore)</p>



<a name="219818086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219818086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219818086">(Dec 14 2020 at 09:41)</a>:</h4>
<p><span class="user-mention" data-user-id="132829">@Christopher Durham</span> no worries, I am tagging you just so you are aware of the work in the area, as I expect you'll be interested in knowning what's going on :D</p>



<a name="219866361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866361">(Dec 14 2020 at 16:31)</a>:</h4>
<p><span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> smoke test passes in a toy impl!</p>



<a name="219866363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866363">(Dec 14 2020 at 16:31)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/mini-rowan/blob/842cf1d8c7ebcc1ebed65f03b78402df3804b921/tests/it.rs#L31-L42">https://github.com/rust-analyzer/mini-rowan/blob/842cf1d8c7ebcc1ebed65f03b78402df3804b921/tests/it.rs#L31-L42</a></p>



<a name="219866571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866571">(Dec 14 2020 at 16:33)</a>:</h4>
<p>Naming Q: how would you name a method of a tree node, which removes the node from the tree?  <code>n.name_me()</code>?</p>
<p>After this call, the original tree doesn't have <code>n</code>, and <code>n</code> is a root of a new tree</p>



<a name="219866605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866605">(Dec 14 2020 at 16:33)</a>:</h4>
<p>Options: <code>remove</code>, <code>delete</code>, <code>detach</code>, <code>unlink</code></p>



<a name="219866719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866719">(Dec 14 2020 at 16:34)</a>:</h4>
<p>Detach or unlink</p>



<a name="219866768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866768">(Dec 14 2020 at 16:34)</a>:</h4>
<p>Or more verbose: to_new_root</p>



<a name="219866863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866863">(Dec 14 2020 at 16:35)</a>:</h4>
<p>I like <code>detach</code></p>



<a name="219866881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219866881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219866881">(Dec 14 2020 at 16:35)</a>:</h4>
<p>^</p>



<a name="219962171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219962171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219962171">(Dec 15 2020 at 10:53)</a>:</h4>
<p>Ok, "move bound to where clause" test now works: <a href="https://github.com/rust-analyzer/mini-rowan/blob/4392883f3ef67f3cf5af8334307e067c356f47f0/tests/it.rs#L32-L49">https://github.com/rust-analyzer/mini-rowan/blob/4392883f3ef67f3cf5af8334307e067c356f47f0/tests/it.rs#L32-L49</a></p>



<a name="219962384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219962384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219962384">(Dec 15 2020 at 10:55)</a>:</h4>
<p>I'll try to extend the prototype to also track text ranges of nodes. I also want to explore whether we can retain <code>fn token_text(&amp;self) -&gt; &amp;self</code> signature</p>



<a name="219962415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/219962415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#219962415">(Dec 15 2020 at 10:55)</a>:</h4>
<p>might not be possible with mutable nodes <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>



<a name="220117007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/220117007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#220117007">(Dec 16 2020 at 13:51)</a>:</h4>
<p>Pushed update with a fuller API with node/token split and <code>text_size</code></p>



<a name="222457702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222457702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222457702">(Jan 12 2021 at 16:38)</a>:</h4>
<p>Current status (aka a hundred segfaults later):</p>
<p><a href="/user_uploads/4715/PAzR3BJeptw0SRCZ_IF8AM9V/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/PAzR3BJeptw0SRCZ_IF8AM9V/image.png" title="image.png"><img src="/user_uploads/4715/PAzR3BJeptw0SRCZ_IF8AM9V/image.png"></a></div><p><a href="/user_uploads/4715/d-NrJbkQKt9yHHOxQyzChleR/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/d-NrJbkQKt9yHHOxQyzChleR/image.png" title="image.png"><img src="/user_uploads/4715/d-NrJbkQKt9yHHOxQyzChleR/image.png"></a></div>



<a name="222457806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222457806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222457806">(Jan 12 2021 at 16:38)</a>:</h4>
<p>the stuff is horrifyingly unsafe inside :(</p>



<a name="222460098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222460098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222460098">(Jan 12 2021 at 16:51)</a>:</h4>
<p>Benches also regress a bit, but I believe that is livable (and there are a couple optimizations we could employ to get some perf back)</p>



<a name="222460164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222460164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222460164">(Jan 12 2021 at 16:52)</a>:</h4>
<div class="codehilite"><pre><span></span><code>Database loaded:     399.46ms, 287minstr, 82mb
  crates: 36, mods: 583, decls: 11311, fns: 8839
Item Collection:     8.58s, 84ginstr, 463mb
  exprs: 243254, ??ty: 2656 (1%), ?ty: 2074 (0%), !ty: 890
Inference:           16.21s, 135ginstr, 637mb
Total:               24.79s, 220ginstr, 1101mb


wip
Database loaded:     394.35ms, 287minstr, 82mb
  crates: 36, mods: 583, decls: 11311, fns: 8839
Item Collection:     10.69s, 109ginstr, 524mb
  exprs: 243254, ??ty: 2656 (1%), ?ty: 2074 (0%), !ty: 890
Inference:           17.13s, 150ginstr, 665mb
Total:               27.82s, 259ginstr, 1190mb
</code></pre></div>



<a name="222470899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222470899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222470899">(Jan 12 2021 at 18:03)</a>:</h4>
<p>Did it get slower because of the struct size increase?</p>



<a name="222471035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471035">(Jan 12 2021 at 18:04)</a>:</h4>
<p>I think that would be part of that</p>



<a name="222471133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471133">(Jan 12 2021 at 18:05)</a>:</h4>
<p>another part is that we now iterate calling next_sibling repeatedly, rather than itering a slice of green nodes</p>



<a name="222471235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471235">(Jan 12 2021 at 18:06)</a>:</h4>
<p>(this is the bit I believe we can speed up quite a bit)</p>



<a name="222471329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471329">(Jan 12 2021 at 18:07)</a>:</h4>
<p>And there's a bit of <code>Cell</code>gets/sets on the immutable path, they migh cause issues</p>



<a name="222471502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471502">(Jan 12 2021 at 18:08)</a>:</h4>
<blockquote>
<p><code>// The following links only have meaning when state is </code>Mut``</p>
</blockquote>
<p>Are they also used/set/kept track of when it's <code>Imm</code>?</p>



<a name="222471945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471945">(Jan 12 2021 at 18:12)</a>:</h4>
<p>I mean, I guess they can't be moved to <code>Imm</code></p>



<a name="222471976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222471976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222471976">(Jan 12 2021 at 18:12)</a>:</h4>
<p>(<code>triomphe#hash</code> isn't published yet)</p>



<a name="222560936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222560936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222560936">(Jan 13 2021 at 10:31)</a>:</h4>
<p>triomphe <em>is</em> published I think?</p>



<a name="222564327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222564327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222564327">(Jan 13 2021 at 11:05)</a>:</h4>
<p>No, see <a href="https://github.com/rust-analyzer/rowan/blob/clone-for-update/Cargo.toml#L14">https://github.com/rust-analyzer/rowan/blob/clone-for-update/Cargo.toml#L14</a></p>



<a name="222564339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222564339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222564339">(Jan 13 2021 at 11:05)</a>:</h4>
<p>The <code>hash</code> branch isn't merged</p>



<a name="222564623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/222564623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#222564623">(Jan 13 2021 at 11:08)</a>:</h4>
<p>Ah, <code>Cargo.toml</code> needs to point to <a href="http://crates.io">crates.io</a></p>



<a name="224199424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/224199424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#224199424">(Jan 27 2021 at 15:42)</a>:</h4>
<p>Current status: leaking so much memory that it overflows allocator's counter: <code>Item Collection:     8.06s, 83ginstr, -367mb</code></p>



<a name="225189046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/225189046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#225189046">(Feb 04 2021 at 16:58)</a>:</h4>
<p>The API is coming along nicely: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/7498/files#diff-92a680dd91492725f6dc97832ef92847fb2027669f6b9a56e2c724c3e8f4df9cR44-R71">https://github.com/rust-analyzer/rust-analyzer/pull/7498/files#diff-92a680dd91492725f6dc97832ef92847fb2027669f6b9a56e2c724c3e8f4df9cR44-R71</a></p>



<a name="225189097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter%20is%20accidentally%20linear/near/225189097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/SyntaxRewriter.20is.20accidentally.20linear.html#225189097">(Feb 04 2021 at 16:58)</a>:</h4>
<p>(although I did spend half of the day hunting for missing refcount increment)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>